from urllib import request

import pytesseract
from PIL import Image
from pyocr import pyocr

'''
sudo pip3 install pytesseract
brew install Tesseract
图片识别
'''

# image_url = 'http://static8.ziroom.com/phoenix/pc/images/price/e1b89727400c2b61fe1018661fada079s.png'

# request.urlretrieve(image_url, '/Users/ddy/tmp.png')

image_content = Image.open(u'/Users/ddy/temp.png')
tools = pyocr.get_available_tools()[:]
text = tools[0].image_to_string(image_content, lang='eng')
text1 = pytesseract.image_to_string(image_content)
print(text)
print(text1)

# 未成功识别
